function E=invfunctionM(E2)

%Does the inverse of functionM
aux=(mod(E2,2)==0);
pos=aux.*(E2/2);
negs=-1*(~aux).*(E2-1)/2;
E=negs+pos;
